<template>
  <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
    <swiper-item v-for="(item, index) in images" :key="index">
      <image :src="item" class="swiper-image" mode="aspectFill" />
    </swiper-item>
  </swiper>
</template>

<script>
export default {
  props: {
    images: {
      type: Array,
      default: () => []
    },
    indicatorDots: {
      type: Boolean,
      default: true
    },
    autoplay: {
      type: Boolean,
      default: true
    },
    interval: {
      type: Number,
      default: 5000
    },
    duration: {
      type: Number,
      default: 500
    }
  }
}
</script>

<style scoped>
.swiper {
  width: 100%;
  height: 250px; /* 设置轮播组件的高度 */
}

.swiper-image {
  width: 100%;
  height: 100%;
}
</style>